#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> team(n * 3);
    for (int i = 0; i < n * 3; i++)
        cin >> team[i];
    sort(team.begin(), team.end());
    long long sum = 0;
    int i = n * 3 - 2;
    int k = n;
    while (k--)
    {
        sum += team[i];
        i -= 2;
    }
    cout << sum;
}